# 参考 https://tldp.org/HOWTO/Adv-Routing-HOWTO/lartc.rpdb.multiple-links.html
# 39.162.22.128/25 网络
# 39.162.22.129 网关
# 39.162.22.129 ip
# eds-6 网卡名
ip route add 39.162.22.128/25 dev eds-6 src 39.162.22.179 table 2006
ip route add default via 39.162.22.129 table 2006
ip route add 39.162.22.128/25 dev eds-6 src 39.162.22.179
ip rule add from 39.162.22.179 table 2006


ip link delete dev em2.102
ip link delete dev macv1

ip link set up em2.102
ip link set up mv-102

ip link set mv-102


ip link add link em2 name em2.102 type vlan id 102
ip link add link em2.102 name macv1 type macvlan mode bridge 00:00:50:91:d7:08
ip link set em2.102 up
ip link set macv1 up mtu 1500



pppd plugin rp-pppoe.so  nic-macv0 noipdefault noauth default-asyncmap hide-password nodetach mtu 1492 mru 1492 noaccomp +ipv6 nodeflate nopcomp novj novjccomp user 637142981974 lcp-echo-interval 20 lcp-echo-failure 3 lcp-echo-failure 3 unit 0 debug

pppd plugin rp-pppoe.so  nic-macv1 noipdefault noauth default-asyncmap hide-password nodetach mtu 1492 mru 1492 noaccomp +ipv6 nodeflate nopcomp novj novjccomp user 637143002842 lcp-echo-interval 20 lcp-echo-failure 3 lcp-echo-failure 3 unit 1 debug


/usr/sbin/pppd ipparam ppp1 linkname ppp1 plugin rp-pppoe.so nic-macv1 noipdefault noauth default-asyncmap hide-password nodetach mtu 1492 mru 1492 noaccomp nodeflate nopcomp novj novjccomp persist maxfail 0 user 637143002842 lcp-echo-interval 80 lcp-echo-failure 2 +ipv6

pppd plugin /usr/lib64/pppd/2.4.5/rp-pppoe.so nic-mv-102 noipdefault noauth default-asyncmap hide-password nodetach mtu 1492 mru 1492 noaccomp +ipv6 nodeflate nopcomp novj novjccomp user 637143002842 lcp-echo-interval 20 lcp-echo-failure 100 lcp-echo-failure 100 unit 2 debug


  pppd plugin /usr/lib64/pppd/2.4.5/rp-pppoe.so nic-mv-102 noauth default-asyncmap hide-password nodetach noaccomp nomagic  nomru nodeflate nopcomp novj novjccomp user 637143002842 lcp-echo-interval 0 lcp-echo-failure 2 unit 2 debug

pppd plugin /usr/lib64/pppd/2.4.5/rp-pppoe.so nic-mv-102 user "637143002842" password "888888" noauth defaultroute usepeerdns debug
sudo pppd debug /dev/ttyUSB0 115200 user "your_username" password "your_password" noauth defaultroute usepeerdns


pppd plugin /usr/lib64/pppd/2.4.5/rp-pppoe.so nic-mv-1 noipdefault noauth default-asyncmap hide-password nodetach mtu 576 mru 576 noaccomp +ipv6 nodeflate nopcomp novj novjccomp user 637142981974 lcp-echo-interval 20 lcp-echo-failure 10  unit 2 debug

# 更多参考
# https://serverfault.com/questions/1130454/allowing-a-route-to-from-network-when-there-are-multiple-networks
# https://serverfault.com/questions/750845/i-have-two-default-entries-in-my-route-table
# https://www.ni.com/zh-cn/support/documentation/supplemental/11/best-practices-for-using-multiple-network-interfaces--nics--with.html#section-2037127716


# "615,static,em1,111.53.188.168/28,111.53.188.161,-"
 #  2: "616,static,em1,111.53.188.152/28,111.53.188.145,-"
 #  3: "629,static,em2,111.53.188.92/28,111.53.188.81,-"
 #  4: "630,static,em2,111.53.188.101/28,111.53.188.97,

10.231.54.75/24  10.231.0.0 em 1
# ip 地址：111.53.188.168   网关 111.53.188.161   mask:28
ip route add 111.53.188.160/28 dev eds-1 src 111.53.188.168 table 2001
ip route add default via 111.53.188.168 table 2001
ip route add 111.53.188.160/28 dev eds-1 src 111.53.188.168
ip rule add from 111.53.188.168 table 2001

ip route add 10.231.54.75/24 dev em1 src 10.231.0.0 table 2000



ip rule add from 111.53.188.152 table 2002
ip route add 111.53.188.144/28 dev eds-2 src 111.53.188.152 table 2002
ip route add default via 111.53.188.152 table 2002



10.0.2.15/24 brd 10.0.2.255
ip rule add from 10.0.2.15 table 2000
ip route add default via 10.0.2.2 table 2000
ip route add 10.231.54.0/24 dev em1 src 10.231.54.75 table 2000


ip rule add from 10.231.54.75 table 2000
ip route add default via 10.231.54.1 table 2000
10.231.54.75



ip rule add from 111.53.188.92 table 2004
ip route add 111.53.188.144/28 dev eds-2 src 111.53.188.92 table 2004
ip route add default via 111.53.188.92 table 2004